package com.hspedu.writer_;

import com.hspedu.reader_.BufferedReader_;

import java.io.*;

/**
 * @author LiuJinTao
 * @className BufferedCopy_
 * @date 2024/06/28 0:11
 * @description TODO
 */
public class BufferedCopy_ {
    public static void main(String[] args) throws IOException {
        String srcpath = "e:\\a.txt";
        String destpath = "e:\\c.txt";
        BufferedWriter bufferedWriter = null;
        BufferedReader bufferedReader = null;
        bufferedWriter = new BufferedWriter(new FileWriter(destpath, true));
        bufferedReader = new BufferedReader(new FileReader(srcpath));
        String line;
        while ((line = bufferedReader.readLine()) != null) {
            bufferedWriter.write(line);
            bufferedWriter.newLine();
        }

        bufferedWriter.close();
        bufferedReader.close();
    }
}
